package com.kmvc.message.activity;

import com.kmvc.message.R;
import com.kmvc.message.tools.ImageTools;

import android.app.Activity;
import android.graphics.Bitmap;
import android.graphics.drawable.BitmapDrawable;
import android.os.Bundle;
import android.view.View;
import android.view.View.OnClickListener;
import android.view.Window;
import android.view.WindowManager;
import android.widget.ImageView;

public class DialogActivity extends Activity  implements OnClickListener {

	private ImageView imageView;
	Bitmap bp=null;
	@SuppressWarnings("deprecation")
	@Override
	protected void onCreate(Bundle savedInstanceState) {
		// TODO Auto-generated method stub
		getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN,
				WindowManager.LayoutParams.FLAG_FULLSCREEN);
		super.requestWindowFeature(Window.FEATURE_NO_TITLE);
		super.onCreate(savedInstanceState);
		setContentView(R.layout.dialog_img);
		String fileDir = getIntent().getStringExtra("file");
		 bp = ImageTools.readBitMap(fileDir, 1);
		if (bp!=null) {
			imageView = (ImageView) findViewById(R.id.dialogimage);
			imageView.setBackgroundDrawable(new BitmapDrawable(bp));		
			imageView.setOnClickListener(this);
		}
		else {
			//bp.recycle();
			this.finish();
		}
		

	}

	
	
	@Override
	public void onBackPressed() {
		this.finish();
		super.onBackPressed();
	}





	@Override
	public void onClick(View v) {
		// TODO Auto-generated method stub
		
	}

}
